home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / www / amitrix / aweb30b_pch.lha / aweb30b / Install_AWeb30b_pch < prev    next >
Text File  |  1997-09-20  |  5KB  |  243 lines

  1. ; $VER: Install_AWeb30b_patch (18.9.97)
  2. ; Description: Installer script for AWeb-II 3.0 -> 3.0b patch
  3.  
  4. (complete 0)
  5.  
  6. (set #welcome
  7.    (cat "This installation procedure installs the AWeb-II 3.0b patch on your system.\n\n"
  8.         "You must have installed AWeb-II 3.0 previously.\n\n"
  9.         "You will need the original AWeb-II 3.0 disks for this installation procedure."
  10.    )
  11. )
  12.  
  13. (set #no_aweb30 
  14.    (cat "AWeb3: assign not found.\nYou haven't properly installed AWeb-II 3.0.\n\n"
  15.         "The AWeb-II 3.0b patch is not applied."
  16.    )
  17. )
  18.  
  19. (set #ask_backup "Do you want to make a backup copy of the currently installed version of AWeb-II?")
  20.  
  21. (set #insert_disk1
  22.    (cat "Please insert disk 1 of the original AWeb-II 3.0 distribution "
  23.         "(AWeb3.0_Disk1) into any drive\n"
  24.    )
  25. )
  26.  
  27. (set #settingup "Setting up utilities")
  28. (set #patching "Patching %s\n\nBe patient, this can take a while...")
  29. (set #installing "Installing %s")
  30.  
  31. (set #invalid_version
  32.    (cat "Patch could not be performed.\n"
  33.         "The file '%s' has an invalid version. This patch can ONLY be applied "
  34.         "to AWeb-II version 3.0 (not 3.0b)\n\n"
  35.         "Installation script terminated."
  36.    )
  37. )
  38.  
  39. (set #ask_run
  40.    (cat "The first time you run AWeb again, you will have to re-enter "
  41.         "the serial number found on the original distribution, and your name.\n\n"
  42.         "Do you want to start AWeb now?"
  43.    )
  44. )
  45.  
  46. (set #ready "Installation of AWeb-II 3.0 -> 3.0b patch complete.")
  47.  
  48.  
  49. ;---- Procedure to patch 1 file from 1 archive ----
  50.  
  51. (procedure P_patch #arc #file #sum #complete
  52.  
  53.    (working (#patching #file))
  54.  
  55.    ; Build command like
  56.    ;  T:lhex -w=T: e AWeb3.0_Disk1:<#arc> <#file>
  57.    ;
  58.    ; extracts 1 file from the archive on the distribution disk into T:
  59.    (run
  60.       ("T:lhex -w=T: e AWeb3.0_Disk1:%s %s" #arc #file)
  61.    )
  62.  
  63.    (complete #complete)
  64.  
  65.    ; Check the checksum of the extracted file
  66.    (if
  67.       (<>
  68.          (getsum (tackon "T:" #file)
  69.          )
  70.          #sum
  71.       )
  72.       (
  73.          (delete (cat "T:" #file) )
  74.          (exit (#invalid_version #file) (quiet))
  75.       )
  76.    )
  77.  
  78.    ; Check the version of the extracted file - it must be 3.0 (not 3.0b)
  79.    (run ("setenv AWEB30BPCHVERSION `version T:%s`" #file)
  80.    )
  81.    (set #version (getenv "AWEB30BPCHVERSION")
  82.    )
  83.    (set #strl
  84.       (-
  85.          (strlen #version)
  86.          3
  87.       )
  88.    )
  89.    (if
  90.       (<>
  91.          (substr #version #strl)
  92.          "3.0"
  93.       )
  94.       (
  95.          (delete (cat "T:" #file) )
  96.          (exit (#invalid_version #file) (quiet))
  97.       )
  98.    )
  99.  
  100.    (complete (+ #complete 10))
  101.  
  102.    ; Build command like
  103.    ;  T:spatch -p<path><#file>.pch -oAWeb3:<#file> T:<#file>
  104.    ;
  105.    ; patches the original file in T: using the .pch file building a new file in AWeb3:
  106.    (run
  107.       (cat
  108.          "T:spatch -p"
  109.          (cat #file ".pch")
  110.          (" -oAWeb3:%s T:%s" #file #file)
  111.       )
  112.    )
  113.  
  114.    ; Delete the extracted file from T:
  115.    (delete
  116.       (cat "T:" #file)
  117.    )
  118. )
  119.  
  120. ;---- Display welcome message ----
  121.  
  122. (message #welcome)
  123.  
  124. (complete 5)
  125.  
  126. ;---- Check the existence of AWeb3: assign ----
  127.  
  128. (if 
  129.    (not (exists "AWeb3:"))
  130.    (
  131.       (message #no_aweb30)
  132.       (exit (quiet))
  133.    )
  134. )
  135.  
  136. (complete 10)
  137.  
  138. ;---- Ask for backup of current versions ----
  139.  
  140. (if
  141.    (askbool
  142.       (prompt #ask_backup)
  143.       (help @askbool-help)
  144.    )
  145.    (
  146.       (copyfiles
  147.          (prompt #make_backup)
  148.          (help @copyfiles-help)
  149.          (source "AWeb3:AWeb-II")
  150.          (dest "AWeb3:")
  151.          (newname "AWeb-II_3.0")
  152.          (optional "nofail")
  153.       )
  154.       (copyfiles
  155.          (prompt #make_backup)
  156.          (help @copyfiles-help)
  157.          (source "AWeb3:AWebCfg")
  158.          (dest "AWeb3:")
  159.          (newname "AWebCfg_3.0")
  160.          (optional "nofail")
  161.       )
  162.    )
  163. )
  164.  
  165. (complete 20)
  166.  
  167. ;---- Let the user insert the correct disk ----
  168.  
  169. (askdisk
  170.    (prompt #insert_disk1)
  171.    (help @askdisk-help)
  172.    (dest "AWeb3.0_Disk1")
  173. ;   (assigns)               ; **** Remove this before distribution ****
  174. )
  175.  
  176. (complete 25)
  177.  
  178. ;---- Copy required utilities to T: ----
  179.  
  180. (copyfiles
  181.    (prompt #settingup)
  182.    (help @copyfiles-help)
  183.    (source "AWeb3.0_Disk1:lhex")
  184.    (dest "T:")
  185. )
  186.  
  187. (copyfiles
  188.    (prompt #settingup)
  189.    (help @copyfiles-help)
  190.    (source (tackon (pathonly @icon) "spatch"))
  191.    (dest "T:")
  192. )
  193.  
  194. (complete 30)
  195.  
  196. ;---- Patch AWeb-II ----
  197.  
  198. (P_patch "aweb2.lha" "AWeb-II" 1498876731 40)
  199.  
  200. (complete 60)
  201.  
  202. ;---- Patch AWebCfg ----
  203.  
  204. (P_patch "aweb1.lha" "AWebCfg" 664509881 70)
  205.  
  206. (complete 90)
  207.  
  208. ;---- Delete utilities from T: ----
  209.  
  210. (delete "T:lhex")
  211. (delete "T:spatch")
  212.  
  213. ;---- Install new documentation ----
  214.  
  215. (copyfiles
  216.    (prompt (#installing "documentation"))
  217.    (help @copyfiles-help)
  218.    (source (tackon (pathonly @icon) "docs"))
  219.    (dest "AWeb3:docs")
  220.    (all)
  221. )
  222.  
  223. (complete 95)
  224.  
  225. ;---- Ask if AWeb should run now to enter the registration details ----
  226.  
  227. (if
  228.    (askbool
  229.       (prompt #ask_run)
  230.       (help @askbool-help)
  231.    )
  232.    (
  233.       (run "run AWeb3:AWeb-II local AWeb3:docs/history.html")
  234.    )
  235. )
  236.  
  237. (complete 100)
  238.  
  239. ;---- Ready ----
  240.  
  241. (exit #ready (quiet))
  242.  
  243.